package org.shoukaiseki.common.utils;


import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
 *
 **/
public class MapUtils {

    public static <K,V> Map<K,V> of(Object... args){
        if ((args.length & 1) != 0) { // implicit nullcheck of input
            throw new InternalError("length is odd");
        }
        Map<K,V> qoJson=new HashMap();
        for (int i = 0; i < args.length; i += 2) {
            @SuppressWarnings("unchecked")
            K k = (K)args[i];
            V v = (V)args[i+1];
            qoJson.put(k,v);
        }
        return qoJson;
    }

}
